CC = gcc
CFLAGS = -lpthread -Wall -g


#OBJS = subscriber.amdelf

#$(OBJS):simple_subscriber.o mqtt.o mqtt_pal.o
#	$(CC) simple_subscriber.o mqtt.o mqtt_pal.o -o $(OBJS) -lpthread

#simple_subscriber.o:simple_subscriber.c
#	$(CC) $(CFLAGS) -c simple_subscriber.c -o simple_subscriber.o

OBJS = publisher.amdelf

$(OBJS):simple_publisher.o mqtt.o mqtt_pal.o
	$(CC) simple_publisher.o mqtt.o mqtt_pal.o -o $(OBJS) -lpthread

simple_publisher.o:simple_publisher.c
	$(CC) $(CFLAGS) -c simple_publisher.c -o simple_publisher.o

mqtt.o:mqtt.c
	$(CC) $(CFLAGS) -c mqtt.c -o mqtt.o

mqtt_pal.o:mqtt_pal.c
	$(CC) $(CFLAGS) -c mqtt_pal.c -o mqtt_pal.o

clean:
	rm *.o *.amdelf

